Telegram Group & Telegram Channel
sleep() vs wait()?

Thread.sleep(ms) — усыпляет поток на указанное время, не освобождая монитор. После паузы поток продолжает выполнение. Используется для временной задержки.

wait() — освобождает монитор и переводит поток в состояние ожидания, пока другой поток не вызовет notify() или notifyAll(). Используется для координации потоков в синхронизированных блоках.

Главное отличие: sleep() просто ставит поток на паузу, wait() передает управление другим потокам, освобождая ресурс.

🐸 Библиотека собеса по Java
Please open Telegram to view this post
VIEW IN TELEGRAM



tg-me.com/java_interview_lib/831
Create:
Last Update:

sleep() vs wait()?

Thread.sleep(ms) — усыпляет поток на указанное время, не освобождая монитор. После паузы поток продолжает выполнение. Используется для временной задержки.

wait() — освобождает монитор и переводит поток в состояние ожидания, пока другой поток не вызовет notify() или notifyAll(). Используется для координации потоков в синхронизированных блоках.

Главное отличие: sleep() просто ставит поток на паузу, wait() передает управление другим потокам, освобождая ресурс.

🐸 Библиотека собеса по Java

BY Библиотека собеса по Java | вопросы с собеседований


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/java_interview_lib/831

View MORE
Open in Telegram


Библиотека собеса по Java | вопросы с собеседований Telegram | DID YOU KNOW?

Date: |

Telegram today rolling out an update which brings with it several new features.The update also adds interactive emoji. When you send one of the select animated emoji in chat, you can now tap on it to initiate a full screen animation. The update also adds interactive emoji. When you send one of the select animated emoji in chat, you can now tap on it to initiate a full screen animation. This is then visible to you or anyone else who's also present in chat at the moment. The animations are also accompanied by vibrations. This is then visible to you or anyone else who's also present in chat at the moment. The animations are also accompanied by vibrations.

What Is Bitcoin?

Bitcoin is a decentralized digital currency that you can buy, sell and exchange directly, without an intermediary like a bank. Bitcoin’s creator, Satoshi Nakamoto, originally described the need for “an electronic payment system based on cryptographic proof instead of trust.” Each and every Bitcoin transaction that’s ever been made exists on a public ledger accessible to everyone, making transactions hard to reverse and difficult to fake. That’s by design: Core to their decentralized nature, Bitcoins aren’t backed by the government or any issuing institution, and there’s nothing to guarantee their value besides the proof baked in the heart of the system. “The reason why it’s worth money is simply because we, as people, decided it has value—same as gold,” says Anton Mozgovoy, co-founder & CEO of digital financial service company Holyheld.

Библиотека собеса по Java | вопросы с собеседований from id


Telegram Библиотека собеса по Java | вопросы с собеседований
FROM USA